/*     */ package dm.jdbc.rowset;
/*     */ 
/*     */ import dm.jdbc.dbaccess.DBError;
/*     */ import java.io.Serializable;
/*     */ import java.sql.SQLException;
/*     */ import java.util.Map;
/*     */ import java.util.Vector;
/*     */ import javax.sql.RowSet;
/*     */ import javax.sql.RowSetEvent;
/*     */ import javax.sql.RowSetListener;
/*     */ import javax.sql.rowset.Joinable;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public abstract class DmdbRowSetInner
/*     */   implements Serializable, Cloneable, Joinable
/*     */ {
/*     */   private String m_url;
/*     */   private String m_dataSourceName;
/*     */   private String m_userName;
/*     */   private String m_password;
/*     */   private String m_command;
/*     */   private int m_transationIsolation;
/*     */   private boolean m_readOnly;
/*     */   private int m_maxFieldSize;
/*     */   private int m_maxRows;
/*     */   private int m_queryTimeout;
/*     */   private int m_rowSetType;
/*     */   private int m_resultConcurrencyType;
/*     */   private boolean m_process_escapes;
/*     */   private int m_direction;
/*     */   private int m_fetchSize;
/*     */   protected Vector<RowSetListener> m_listeners;
/*     */   protected RowSetEvent m_rowsetEvent;
/*     */   protected boolean m_showDeleted;
/*     */   private Vector<Integer> m_matchColIndexes;
/*     */   private Vector<String> m_matchColNames;
/*  45 */   private Map<String, Class<?>> m_typeMap = null;
/*     */   
/*     */   private void initializeProps() {
/*  48 */     this.m_process_escapes = true;
/*  49 */     this.m_showDeleted = false;
/*  50 */     this.m_rowSetType = 1004;
/*  51 */     this.m_direction = 1000;
/*  52 */     this.m_readOnly = false;
/*  53 */     this.m_maxFieldSize = 0;
/*  54 */     this.m_maxRows = 0;
/*  55 */     this.m_fetchSize = 0;
/*  56 */     this.m_queryTimeout = 0;
/*  57 */     this.m_url = "";
/*  58 */     this.m_userName = "";
/*  59 */     this.m_password = "";
/*  60 */     this.m_command = "";
/*  61 */     this.m_resultConcurrencyType = 1008;
/*  62 */     this.m_transationIsolation = 2;
/*     */   }
/*     */   
/*     */   protected DmdbRowSetInner() {
/*  66 */     initializeProps();
/*  67 */     this.m_listeners = new Vector();
/*  68 */     this.m_rowsetEvent = new RowSetEvent((RowSet)this);
/*     */     
/*  70 */     this.m_matchColIndexes = new Vector(10);
/*  71 */     this.m_matchColNames = new Vector(10);
/*     */   }
/*     */   
/*     */   protected final void notifyRowSetChanged() {
/*  75 */     int i = this.m_listeners.size();
/*  76 */     if (i > 0) {
/*  77 */       for (int j = 0; j < i; j++)
/*     */       {
/*  79 */         ((RowSetListener)this.m_listeners.elementAt(j)).rowSetChanged(this.m_rowsetEvent);
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */   protected final void notifyCursorMovement() {
/*  85 */     int i = this.m_listeners.size();
/*  86 */     if (i > 0) {
/*  87 */       for (int j = 0; j < i; j++)
/*     */       {
/*  89 */         ((RowSetListener)this.m_listeners.elementAt(j)).cursorMoved(this.m_rowsetEvent);
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */   protected final void notifyRowChanged() {
/*  95 */     int i = this.m_listeners.size();
/*  96 */     if (i > 0) {
/*  97 */       for (int j = 0; j < i; j++)
/*     */       {
/*  99 */         ((RowSetListener)this.m_listeners.elementAt(j)).rowChanged(this.m_rowsetEvent);
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */   protected final void notifyUpdateListeners() {
/* 105 */     int i = this.m_listeners.size();
/* 106 */     if (i > 0) {
/* 107 */       for (int j = 0; j < i; j++)
/*     */       {
/* 109 */         ((RowSetListener)this.m_listeners.elementAt(j)).rowChanged(this.m_rowsetEvent);
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */   private final void unsetColIndexIfSet(int columnIdx) throws SQLException {
/* 115 */     int size = this.m_matchColIndexes.size();
/* 116 */     int[] unsetInd = new int[size];
/* 117 */     int cnt = 0;
/*     */     
/* 119 */     if (columnIdx <= 0) {
/* 120 */       DBError.throwSQLException(20007);
/*     */     }
/* 122 */     for (int i = 0; i < size; i++) {
/* 123 */       if (((Integer)this.m_matchColIndexes.get(i)).equals(Integer.valueOf(columnIdx))) {
/* 124 */         unsetInd[cnt] = i;
/* 125 */         cnt++;
/*     */       }
/*     */     }
/* 128 */     if (cnt == 0) {
/* 129 */       DBError.throwSQLException(20014);
/*     */     }
/* 131 */     for (int i = cnt - 1; i >= 0; i--)
/* 132 */       this.m_matchColIndexes.remove(unsetInd[i]);
/*     */   }
/*     */   
/*     */   private final void unsetColNameIfSet(String columnName) throws SQLException {
/* 136 */     int size = this.m_matchColNames.size();
/* 137 */     int[] unsetInd = new int[size];
/* 138 */     int cnt = 0;
/*     */     
/* 140 */     if ((columnName == null) || (columnName == "")) {
/* 141 */       DBError.throwSQLException(20009);
/*     */     }
/* 143 */     for (int i = 0; i < size; i++) {
/* 144 */       if (((String)this.m_matchColNames.get(i)).equalsIgnoreCase(columnName)) {
/* 145 */         unsetInd[i] = i;
/* 146 */         cnt++;
/*     */       }
/*     */     }
/* 149 */     if (cnt == 0) {
/* 150 */       DBError.throwSQLException(20015);
/*     */     }
/* 152 */     for (int i = cnt - 1; i >= 0; i--)
/* 153 */       this.m_matchColNames.remove(unsetInd[i]);
/*     */   }
/*     */   
/*     */   public void setMatchColumn(int columnIdx) throws SQLException {
/* 157 */     if (columnIdx <= 0) {
/* 158 */       DBError.throwSQLException(20007);
/*     */     }
/* 160 */     this.m_matchColIndexes.clear();
/* 161 */     this.m_matchColNames.clear();
/* 162 */     this.m_matchColIndexes.add(Integer.valueOf(columnIdx));
/*     */   }
/*     */   
/*     */   public void setMatchColumn(int[] columnIdxes) throws SQLException {
/* 166 */     if (columnIdxes == null) {
/* 167 */       DBError.throwSQLException(20008);
/*     */     }
/* 169 */     this.m_matchColIndexes.clear();
/* 170 */     this.m_matchColNames.clear();
/*     */     
/* 172 */     for (int i = 0; i < columnIdxes.length; i++) {
/* 173 */       if (columnIdxes[i] <= 0) {
/* 174 */         DBError.throwSQLException(20007);
/*     */       }
/* 176 */       this.m_matchColIndexes.add(Integer.valueOf(columnIdxes[i]));
/*     */     }
/*     */   }
/*     */   
/*     */   public void setMatchColumn(String columnName) throws SQLException {
/* 181 */     if ((columnName == null) || (columnName == "")) {
/* 182 */       DBError.throwSQLException(20009);
/*     */     }
/* 184 */     this.m_matchColIndexes.clear();
/* 185 */     this.m_matchColNames.clear();
/*     */     
/* 187 */     this.m_matchColNames.add(columnName);
/*     */   }
/*     */   
/*     */   public void setMatchColumn(String[] columnNames) throws SQLException {
/* 191 */     if (columnNames == null) {
/* 192 */       DBError.throwSQLException(20010);
/*     */     }
/* 194 */     this.m_matchColIndexes.clear();
/* 195 */     this.m_matchColNames.clear();
/*     */     
/* 197 */     for (int i = 0; i < columnNames.length; i++) {
/* 198 */       if ((columnNames[i] == null) || (columnNames[i] == "")) {
/* 199 */         DBError.throwSQLException(20009);
/*     */       }
/* 201 */       this.m_matchColNames.add(columnNames[i]);
/*     */     }
/*     */   }
/*     */   
/*     */   public abstract int findColumn(String paramString) throws SQLException;
/*     */   
/*     */   public int[] getMatchColumnIndexes() throws SQLException {
/* 208 */     if ((this.m_matchColIndexes.isEmpty()) && (this.m_matchColNames.isEmpty())) {
/* 209 */       DBError.throwSQLException(20011);
/*     */     }
/* 211 */     int[] ret = null;
/* 212 */     int size = 0;
/* 213 */     if (!this.m_matchColIndexes.isEmpty()) {
/* 214 */       size = this.m_matchColIndexes.size();
/* 215 */       ret = new int[size];
/* 216 */       for (int i = 0; i < size; i++)
/* 217 */         ret[i] = ((Integer)this.m_matchColIndexes.get(i)).intValue();
/*     */     } else {
/* 219 */       size = this.m_matchColNames.size();
/* 220 */       ret = new int[size];
/* 221 */       for (int i = 0; i < size; i++) {
/* 222 */         ret[i] = findColumn((String)this.m_matchColNames.get(i));
/*     */       }
/*     */     }
/* 225 */     return ret;
/*     */   }
/*     */   
/*     */   public String[] getMatchColumnNames() throws SQLException {
/* 229 */     if (this.m_matchColNames.isEmpty()) {
/* 230 */       DBError.throwSQLException(20012);
/*     */     }
/* 232 */     String[] ret = null;
/* 233 */     int size = this.m_matchColNames.size();
/* 234 */     ret = new String[size];
/* 235 */     for (int i = 0; i < size; i++) {
/* 236 */       ret[i] = ((String)this.m_matchColNames.get(i));
/*     */     }
/* 238 */     return ret;
/*     */   }
/*     */   
/*     */   public void unsetMatchColumn(int columnIdx) throws SQLException {
/* 242 */     if (this.m_matchColIndexes.isEmpty()) {
/* 243 */       DBError.throwSQLException(20013);
/*     */     }
/* 245 */     unsetColIndexIfSet(columnIdx);
/*     */   }
/*     */   
/*     */   public void unsetMatchColumn(int[] columnIdxes) throws SQLException {
/* 249 */     if (this.m_matchColIndexes.isEmpty()) {
/* 250 */       DBError.throwSQLException(20013);
/*     */     }
/* 252 */     if (columnIdxes == null) {
/* 253 */       DBError.throwSQLException(20008);
/*     */     }
/* 255 */     for (int i = 0; i < columnIdxes.length; i++)
/* 256 */       unsetColIndexIfSet(columnIdxes[i]);
/*     */   }
/*     */   
/*     */   public void unsetMatchColumn(String columnName) throws SQLException {
/* 260 */     if (this.m_matchColNames.isEmpty()) {
/* 261 */       DBError.throwSQLException(20012);
/*     */     }
/* 263 */     unsetColNameIfSet(columnName);
/*     */   }
/*     */   
/*     */   public void unsetMatchColumn(String[] columnName) throws SQLException {
/* 267 */     if (this.m_matchColNames.isEmpty()) {
/* 268 */       DBError.throwSQLException(20012);
/*     */     }
/* 270 */     if (columnName == null) {
/* 271 */       DBError.throwSQLException(20010);
/*     */     }
/* 273 */     for (int i = 0; i < columnName.length; i++)
/* 274 */       unsetColNameIfSet(columnName[i]);
/*     */   }
/*     */   
/*     */   public void setFetchDirection(int direction) throws SQLException {
/* 278 */     this.m_direction = direction;
/*     */   }
/*     */   
/*     */   public int getFetchDirection() throws SQLException {
/* 282 */     return this.m_direction;
/*     */   }
/*     */   
/*     */   public void setFetchSize(int rows) throws SQLException {
/* 286 */     this.m_fetchSize = rows;
/*     */   }
/*     */   
/*     */   public int getFetchSize() throws SQLException {
/* 290 */     return this.m_fetchSize;
/*     */   }
/*     */   
/*     */   public int getType() throws SQLException {
/* 294 */     return this.m_rowSetType;
/*     */   }
/*     */   
/*     */   public int getConcurrency() throws SQLException {
/* 298 */     return this.m_resultConcurrencyType;
/*     */   }
/*     */   
/*     */   public String getUrl() throws SQLException {
/* 302 */     return this.m_url;
/*     */   }
/*     */   
/*     */   public void setUrl(String url) throws SQLException {
/* 306 */     this.m_url = url;
/*     */   }
/*     */   
/*     */   public String getDataSourceName() {
/* 310 */     return this.m_dataSourceName;
/*     */   }
/*     */   
/*     */   public void setDataSourceName(String name) throws SQLException {
/* 314 */     this.m_dataSourceName = name;
/*     */   }
/*     */   
/*     */   public String getUsername() {
/* 318 */     return this.m_userName;
/*     */   }
/*     */   
/*     */   public void setUsername(String name) throws SQLException {
/* 322 */     this.m_userName = name;
/*     */   }
/*     */   
/*     */   public String getPassword() {
/* 326 */     return this.m_password;
/*     */   }
/*     */   
/*     */   public void setPassword(String password) throws SQLException {
/* 330 */     this.m_password = password;
/*     */   }
/*     */   
/*     */   public int getTransactionIsolation() {
/* 334 */     return this.m_transationIsolation;
/*     */   }
/*     */   
/*     */   public void setTransactionIsolation(int level) throws SQLException {
/* 338 */     this.m_transationIsolation = level;
/*     */   }
/*     */   
/*     */   public Map<String, Class<?>> getTypeMap() throws SQLException {
/* 342 */     return this.m_typeMap;
/*     */   }
/*     */   
/*     */   public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
/* 346 */     this.m_typeMap = map;
/*     */   }
/*     */   
/*     */   public String getCommand() {
/* 350 */     return this.m_command;
/*     */   }
/*     */   
/*     */   public void setCommand(String cmd) throws SQLException {
/* 354 */     this.m_command = cmd;
/*     */   }
/*     */   
/*     */   public boolean isReadOnly() {
/* 358 */     return this.m_readOnly;
/*     */   }
/*     */   
/*     */   public void setReadOnly(boolean value) throws SQLException {
/* 362 */     this.m_readOnly = value;
/*     */   }
/*     */   
/*     */   public int getMaxFieldSize() throws SQLException {
/* 366 */     return this.m_maxFieldSize;
/*     */   }
/*     */   
/*     */   public void setMaxFieldSize(int max) throws SQLException {
/* 370 */     this.m_maxFieldSize = max;
/*     */   }
/*     */   
/*     */   public int getMaxRows() throws SQLException {
/* 374 */     return this.m_maxRows;
/*     */   }
/*     */   
/*     */   public void setMaxRows(int max) throws SQLException {
/* 378 */     this.m_maxRows = max;
/*     */   }
/*     */   
/*     */   public boolean getEscapeProcessing() throws SQLException {
/* 382 */     return this.m_process_escapes;
/*     */   }
/*     */   
/*     */   public void setEscapeProcessing(boolean enable) throws SQLException {
/* 386 */     this.m_process_escapes = enable;
/*     */   }
/*     */   
/*     */   public int getQueryTimeout() throws SQLException {
/* 390 */     return this.m_queryTimeout;
/*     */   }
/*     */   
/*     */   public void setQueryTimeout(int seconds) throws SQLException {
/* 394 */     this.m_queryTimeout = seconds;
/*     */   }
/*     */   
/*     */   public boolean getShowDeleted() throws SQLException {
/* 398 */     return this.m_showDeleted;
/*     */   }
/*     */   
/*     */   public void setShowDeleted(boolean b) throws SQLException {
/* 402 */     this.m_showDeleted = b;
/*     */   }
/*     */   
/*     */   public void setType(int type) throws SQLException {
/* 406 */     this.m_rowSetType = type;
/*     */   }
/*     */   
/*     */   public void setConcurrency(int concurrency) throws SQLException {
/* 410 */     this.m_resultConcurrencyType = concurrency;
/*     */   }
/*     */   
/*     */   public void addRowSetListener(RowSetListener listener) {
/* 414 */     for (int i = 0; i < this.m_listeners.size(); i++) {
/* 415 */       if (((RowSetListener)this.m_listeners.get(i)).equals(listener))
/* 416 */         return;
/*     */     }
/* 418 */     this.m_listeners.add(listener);
/*     */   }
/*     */   
/*     */   public void removeRowSetListener(RowSetListener listener) {
/* 422 */     for (int i = 0; i < this.m_listeners.size(); i++) {
/* 423 */       if (((RowSetListener)this.m_listeners.get(i)).equals(listener)) {
/* 424 */         this.m_listeners.remove(i);
/*     */       }
/*     */     }
/*     */   }
/*     */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\rowset\DmdbRowSetInner.class
 * Java compiler version: 5 (49.0)
 * JD-Core Version:       0.7.1
 */